package com.qzy.demo.mapper;

import com.qzy.demo.pojo.UPermissionPojo;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UPermissionMapper {
    @Select("SELECT p.* from u_user_role urole left join  u_role_permission rp   on urole.rid=rp.rid  left join  u_permission p on p.id = rp.pid  where urole.uid = #{uid}")
    @Results({
            @Result(property = "id",  column = "id"),
            @Result(property = "url",  column = "url"),
            @Result(property = "name", column = "name"),
    })
    List<UPermissionPojo> findPermissionByUid(Long id);
}
